package com.zhoushihao.class0818;

import java.util.*;

public class SelectPoint {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<TestPoint> points = new ArrayList<>();
        TestPoint personPoint = new TestPoint(sc.nextInt(), sc.nextInt(),0);
        for (int i = 0; i < n; i++) {
            points.add(new TestPoint(sc.nextInt(), sc.nextInt(), i+1));
            points.get(i).distance = personPoint.getDistance(points.get(i));
        }
        Collections.sort(points);
        for (int i = 0; i < 3; i++) {
            System.out.println(points.get(i).no);
        }
    }

}
class TestPoint implements Comparable<TestPoint> {
    int x, y;
    double distance;
    int no;
    public TestPoint(int x, int y, int no) {
        this.x = x;
        this.y = y;
        this.no = no;
    }
    public double getDistance(TestPoint p) {
        return Math.sqrt(Math.pow(p.x - x, 2) + Math.pow(p.y - y, 2));
    }


    @Override
    public int compareTo(TestPoint o) {
        if (this.distance > o.distance) {
            return 1;
        }
        else if (this.distance < o.distance) {
            return -1;
        }
        else{
            return this.no - o.no;
        }
    }
}
